<template>
  <header class="header">
     <div class="header-left">
       <span class="iconfont">&#xe697;</span>
     </div>
     <div class="header-input">
       <span class="iconfont">&#xe6ac;</span>
       输入城市/景点/游玩主题
     </div>
     <router-link to="/city">
      <div class="header-area">
        <!-- 获取Vuex $store.state.city -->
        {{this.city}}
        <span class="iconfont">&#xe615;</span>
        </div>
      </router-link>
  </header>
</template>

<script>
import { mapState } from 'vuex'
export default {
  name: 'Header',
  computed: {
    ...mapState(['city'])
  }
}
</script>

<style lang="less" scoped>
@import '~styles/varlibase.less';
.header{
  display: flex;
  flex: 1;
  justify-content: space-between;
  line-height: @headerHight;
  background-color: @bgColor;
  color: #fff;
  height: @headerHight;
  .header-left{
    padding: 0 10rem/50;
    span{
      display: block;
      font-size: 28rem / 50;
    }
  }
  .header-input{
    background-color: #fff;
    color: #e4e7ea;
    line-height: 30rem / 50;
    margin: 7rem /50 0;
    width: 260rem / 50;
    border-radius: 3rem / 50;
    span{
      padding-left: 10rem / 50;
    }
  }
  .header-area{
    padding: 0 10rem/50;
    color: #fff;
    span{
      font-size: 10rem / 50;
    }
  }
}
</style>
